//
//  UIFoundationPrefix.h
//  SMILE
//
//  Created by SMILE on 12-12-3.
//  Copyright (c) 2012年 SMILE. All rights reserved.
//

#import "UIPathGetter.h"

#ifndef SMILE_UIFoundationPrefix_h
#define SMILE_UIFoundationPrefix_h

#define UIPathResolve(_fileName)    _fileName


#define UIDocumentFile(fileName)  [[UIPathGetter systemPath] filePathInDocumentPathForName:fileName]

#define UIResourceFile(fileName) [[UIPathGetter systemPath] filePathInResourcePathForName:fileName]

#define UILibaryFile(fileName) [[UIPathGetter systemPath] filePathInLibaryPathForName:fileName]

#define UITemporaryFile(fileName) [[UIPathGetter systemPath] filePathInTemporaryPathForName:fileName]

#define UIDocumentPath [[UIPathGetter systemPath] documentPath]

#define UIResourcePath [[UIPathGetter systemPath] resourcePath]

#define UILibaryPath [[UIPathGetter systemPath] libaryPath]

#define UITemporaryPath  [[UIPathGetter systemPath] temporaryPath]

#define UIImageCached(_imageName)  [UIImage imageNamed:UIPathResolve(_imageName)]

#define UIImageResource(_imageName)   [UIImage imageWithContentsOfFile:UIResourceFile(_imageName)]
#define UIImageDocument(_imageName)   [UIImage imageWithContentsOfFile:UIDocumentFile(_imageName)]
#define UIImageLibary(_imageName)   [UIImage imageWithContentsOfFile:\
    UILibaryFile(_imageName)]
#define UIImageTemporary(_imageName)   [UIImage imageWithContentsOfFile:UITemporaryFile(_imageName)]


#define UIRelease(_pointer)     { [_pointer release];_pointer = nil;}
#define UIAutoRelease(_pointer) [_pointer autorelease] 
#define UIRetain(_pointer)      [_pointer retain]


#define TEXTSIZE_10  10.0f
#define TEXTSIZE_11  11.0f
#define TEXTSIZE_12  12.0f
#define TEXTSIZE_13  13.0f
#define TEXTSIZE_14  14.0f
#define TEXTSIZE_15  15.0f
#define TEXTSIZE_16  16.0f
#define TEXTSIZE_17  17.0f
#define TEXTSIZE_18  18.0f
#define TEXTSIZE_19  19.0f
#define TEXTSIZE_20  20.0f
#define TEXTSIZE_21  21.0f
#define TEXTSIZE_22  22.0f
#define TEXTSIZE_23  23.0f
#define TEXTSIZE_24  24.0f
#define TEXTSIZE_25  25.0f
#define TEXTSIZE_26  26.0f

#define UIFontOfSize(size)  [UIFont systemFontOfSize:size]

#define UIColorRGBA(r,g,b,a)   [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]

#define UIColorRGB(r,g,b) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1]

#define UIBlackColor        [UIColor blackColor]
#define UIDarkGrayColor     [UIColor darkGrayColor]
#define UILightGrayColor    [UIColor lightGrayColor]
#define UIWhiteColor        [UIColor whiteColor]
#define UIGrayColor         [UIColor grayColor]
#define UIRedColor          [UIColor redColor]
#define UIGreenColor        [UIColor greenColor]
#define UIBlueColor         [UIColor blueColor]
#define UICyanColor         [UIColor cyanColor]
#define UIYellowColor       [UIColor yellowColor]
#define UIMagentaColor      [UIColor magentaColor]
#define UIOrangeColor       [UIColor orangeColor]
#define UIPurpleColor       [UIColor purpleColor]
#define UIBrownColor        [UIColor brownColor]
#define UIClearColor        [UIColor clearColor]

#define UIGetString(key)    NSLocalizedString(key, nil)


#endif
